package com.bike.util;

import java.lang.reflect.Method;
import org.springframework.cache.interceptor.KeyGenerator;

public class CacheKeyGenerator implements KeyGenerator{

	@Override
	public Object generate(Object targetobject, Method method, Object... args) {
		 String classname=targetobject.getClass().getSimpleName();
		 String mname=method.getName();
		 String params="";
		if(args!=null&&args.length>0){
			for(Object o:args){
				params+=o.toString();
			}
		}
		 String key=classname+"."+mname+"("+params+")";
		 return key;
	}
	
}
